Generating proxy automatic configuration scripts

ABSTRACT

Methods and systems for generating a proxy automatic configuration (PAC) script based on the location of a device. One example method includes receiving a request for a proxy automatic configuration (PAC) script from a source address associated with a device; determining, based at least in part on the source address, a location of the device; generating a PAC script based at least in part on the determined location of the device; and sending a response to the request for the PAC script including the generated PAC script.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of and claims priority toU.S. application Ser. No. 14/257,912, filed on Apr. 21, 2014.

BACKGROUND

This specification generally relates to generating proxy automaticconfiguration scripts in response to requests from user devices on anetwork.

In corporate and other networks, user devices may be configured toaccess a network in different ways. For example, devices may receiveconfiguration information when they log on to a network from a centrallocation, or may be initialized with such configuration information atregular intervals. The configuration information may control the networkaccess behavior of the particular device.

SUMMARY

In general, one aspect of the subject matter described in thisspecification may be embodied in systems, and methods performed by dataprocessing apparatuses that include the actions of receiving a requestfor a proxy automatic configuration (PAC) script from a source addressassociated with a device; determining, based at least in part on thesource address, a location of the device; generating a PAC script basedat least in part on the determined location of the device; and sending aresponse to the request for the PAC script including the generated PACscript.

Details of one or more implementations of the subject matter describedin this specification are set forth in the accompanying drawings and thedescription below. Other features, aspects, and potential advantages ofthe subject matter will become apparent from the description, thedrawings, and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram of an example environment.

FIG. 2 is a message flow diagram of an example interaction between thecomponents of the example network to generate PAC scripts based on thelocations of the user devices.

FIG. 3 is a flow chart of an example process of generating PAC scriptsbased on locations of user devices.

FIG. 4 is a diagram of computing devices that may be used to implementthe systems and methods described herein.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

Proxy automatic configuration or “PAC” scripts are used to control thenetwork access behavior of devices. For example, a PAC script mayinclude instructions to be executed by a device when accessing anetwork, such as instructions directing the device to use a particulargateway or proxy server when accessing an external network. PAC scriptsare generally provided to devices, such as in response to requests, bynetwork management systems, such as, for example, a mobile devicemanagement (MDM) system.

Network operators may desire to configure devices to perform differentnetwork access behaviors based on the device's location. For example, ifa device is connected to an internal network (e.g., “on premise”) thedevice may use a proxy server, while the device may not use a proxyserver when connected to an external network (e.g., when “off premise”).One way to implement such behavior is to include appropriateinstructions within a PAC script for the device. However, such asolution may be inflexible, as the device will use this sameconfiguration until it receives a new PAC script.

The present disclosure describes, among other things, techniques forgenerating PAC scripts based on the locations of the devices. In oneexample, a request is received for a PAC script. The request is receivedfrom a source address associated with a device, such as an InternetProtocol (IP) address. From the source address, a location of the deviceis determined. For example, the device may be determined to be “onpremise,” “off premise,” or some other specific location. A PAC scriptis then generated based at least in part on the determined location ofthe device. The generated PAC script is then sent to the device inresponse to the request.

Implementations according to the present disclosure have severalpotential advantages. First, a network owner or administrator may beable to manage network access more efficiently than with previoustechniques. For example, changes the network access behavior for devicesat a specific location may be implemented quickly by changing the PACscript generated for that location. When new devices request a PACscript from that location, they will get the new PAC script and performthe desired behavior. Further, a network owner may be allowed greatercontrol over network access behavior than with previous techniques, asmany different PAC scripts can be generated based on different devicelocations beyond simply “on premise” and “off premise.”

FIG. 1 is a diagram of an example environment 100 in which variousaspects of the subject matter described here may be implemented. Theexample environment 100 includes an internal network 110 connecting oneor more devices 130 a-c to a network management system 120. The networkmanagement system 120 is connected to a database 160. The gateway server140 separates the internal network 110 from the external network 150. Adevice 170 is connected to the external network 150. A plurality ofwebsites 180 are also connected to the external network 150.

In one example implementation, the example environment 100 allows thedevices 130 a-c and the device 170 to receive different PAC scriptsbased on their respective locations. In such an implementation, each ofthe one or more devices 130 a-c and the device 170 is configured with aPAC script URL. The PAC script URLs may be configured by the networkmanagement system 120, a mobile device management (MDM) system, and/orother systems. In some implementations, each PAC script URL includes theaddress of the network management system 120. The devices 130 a-c andthe device 170 may send requests for PAC scripts to the networkmanagement system 120 based on the PAC script URLs.

In some implementations, when each of the one or more devices 130 a-cconnects to the internal network 110, the device may request a PACscript from its configured PAC script URL. The network management system120 receives the PAC script requests from the source addressesassociated with the one or more devices 130 a-c. In some cases, thesource addresses may be Internet Protocol (IP) addresses, Medium AccessControl (MAC) addresses, or other types of addresses. In someimplementations, the source address associated with a device indicatesthe type of network that the device is connected to. In the illustratedexample, the devices 130 a-c are connected to the internal network 110,the source addresses associated with the devices 130 a-c may thereforebe local network addresses.

In some implementations, the network management system 120 determinesthe location of a device based on the source address associated with thedevice. In the illustrated example, the source addresses associated withthe devices 130 a-c are local network addresses, because the devices 130a-c are connected to the internal network 110. The network managementsystem 120 may therefore determine that the locations of the devices 130a-c are on-premise, and may generate and respond with an appropriate PACscript for this location.

When the device 170 connects to the external network 150, the device 170may also request a PAC script from the device's configured PAC scriptURL. The request may be transmitted to the network management system120. In the illustrated example, the device 170 is connected to theexternal network 150. The source address associated with the device 170may therefore be a public network address. Accordingly, the networkmanagement system 120 may determine that the location of the device 170is off-premise, and may generate and respond with an appropriate PACscript for this location.

The network management system 120 may also determine more specificlocations for devices based on the source address associated with thePAC script request, and respond with a PAC script generated specificallyfor that location. For example, the source address may indicate that thedevice is in a particular geographic area (e.g., a particular city,country, region, etc.), a particular part of the internal network 110(e.g., a certain office location), or may indicate certain features ofan external network to which the device is connected, such as an ownerof the external network. The network management system 120 may generatedifferent PAC scripts based on the different determined locations.

As shown, the example environment 100 includes an internal network 110.In some implementations, the internal network 110 may be a wirelessnetwork provided by a corporation, educational institution,municipality, business, or other entity. Such a wireless network mayutilize any standard wireless networking technology, including 802.11a,802.11b, 802.11g, 802.11n, LTE, WiMax, CDMA or any other suitablewireless networking technology. In some implementations, the entity thatcontrols the internal network 110 may issue devices to users for use onthe internal network 110. The internal network 110 may also be a wirednetwork, such as an Ethernet network.

One or more devices 130 a-c are connected to the internal network 110.In some implementations, the one or more devices 130 a-c include mobiledevices, such as cellular telephones (e.g., 130 a), smartphones,tablets, laptops (e.g., 130 b) and other similar computing devices. Theone or more devices 130 a-c may also include wired devices such asdesktop computer 130 c. In some implementations, the one or more devices130 a-c include personal devices associated with one or more users. Theone or more devices 130 a-c may also include devices issued or owned bythe entity that provides the internal network 110, such ascompany-issued smartphones or laptops. In some implementations, the oneor more devices 130 a-c may include network access or web browsingsoftware (e.g., a web browser) for accessing resources on the externalnetwork 150.

A device 170 is connected to the external network 150. Similar to theone or more devices 130 a-c, the device 170 may be a cellular telephone,a smartphone, a tablet, a laptop, a desktop computer, or other computingdevices. The device 170 may be a personal device or a device issued bythe entity that provides the internal network 110. The device 170 mayinclude network access or web browsing software (e.g., a web browser)for accessing resources on the external network 150.

A network management system 120 is connected to the internal network110. In some implementations, the network management system 120 may be acomputing device or set of devices operable to manage configurationinformation associated with the one or more devices 130 a-c and thedevice 170. The network management system 120 may include an MDM systemfor managing configuration information associated with mobile and otherdevices. In some cases, the network management system 120 may includethe gateway server 140 and/or other components.

As shown, the network management system 120 includes a PAC scriptrequest handler 122. In some implementations, the PAC script requesthandler 122 may be operable to receive PAC script requests from the oneor more devices 130 a-c and the device 170. The PAC script request maybe received via the Hypertext Transfer Protocol (HTTP), and may includea URL associated with the requested PAC script.

The network management system 120 also includes a location detectioncomponent 124. In some implementations, the location detection component124 is operable to receive as input the PAC script request from the PACscript request handler 122 and determine the location of the device thatsends the request. In some cases, the location detection component 124may identify the source address associated with the received PAC scriptrequest, such as, for example, by examining the request, by callingsystem calls to determine the source address, by analyzing attributes ofa socket on which the request was received, or by other mechanisms. Fromthe source address, the location detection component 124 may determine alocation associated with the device that sent the request. For example,the location detection component 124 may determine that the device ison-premise if the source address is a local network address, anddetermine that the device is off-premise if the source address is apublic network address. The location detection component 124 may also,as discussed previously, determine a geographic location associated withthe device, a specific network associated with the device, an officelocation associated with the device, or other types locations. In someimplementations, the location detection component 124 sends thedetermined location to the database 160 to query for the PAC scriptcorresponding to the location of the device, or for PAC scriptparameters to be used when generating an appropriate PAC scrip for thelocation.

The example environment 100 also includes a database 160. The database160 may be one of or a combination of several commercially availabledatabase and non-database products. Acceptable products include, but arenot limited to Oracle® databases, IBM® Informix® or DB2® databases,MySQL, Microsoft SQL Server®, Ingres®, PostgreSQL, Teradata, AmazonSimpleDB, and Microsoft® Excel, as well as other database andnon-database products. Further, database 160 may be operable to processqueries specified in any structured or other query language such as, forexample, Structured Query Language (SQL). In some implementations, thedatabase 160 may be a file system or storage structure located onseparate from or co-located with the network management system 120. Thedatabase 160 may also be or set of files within such a file systemincluding configuration information related to the network managementsystem 120.

The database 160 includes PAC scripts 162. In some implementations, thePAC scripts 162 may be collections of instructions to be executed by adevice in order to access the external network 150. The following is anexample PAC script:

function FindProxyForURL(url,host) {  if(isResolvable(“mydomain.local”)) {   return “DIRECT”;  }  else  {   return “PROXYusername:password@1.2.3.4”;  } }

This example PAC script will cause the receiving device to access localaddresses directly, while using the gateway server “1.2.3.4” for allother requests. In this example, the PAC script is implemented in theJavaScript language. The PAC scripts 162 may include instructionswritten in other languages including Python, Perl, PHP, and/or otherlanguages.

In response to queries from the network management system 120, thedatabase 160 may provide different PAC scripts based on the location ofthe device that sends the request. For example, the PAC scripts 162 mayinclude an “on-premise” PAC script and an “off-premise” PAC script. The“on-premise” PAC script includes instructions configured to routenetwork traffic through a gateway server. The “off-premise” PAC scriptincludes instructions configured to route network traffic directly tothe external network 150. In some implementations, the networkmanagement system 120 determines that the one or more devices 130 a-care on-premise. In response to the queries from network managementsystem 120 for the on-premise devices, the database 160 may provide the“on-premise” PAC script. In some implementations, the “on-premise” PACscript may be generated upon receipt of the request by the networkmanagement system 120.

In another example, the network management system 120 may determine thatthe device 170 is off-premise. In response to the query from the networkmanagement system 120 for an off-premise device, the database 160 mayprovide the “off-premise” PAC script. In some implementations, the“off-premise” PAC script may be generated upon receipt of the request bythe network management system 120. In some cases, the network managementsystem 120 may determine a more specific location for the device, suchas a geographic location or a particular network location, and select orgenerate a PAC script based on this location.

The PAC scripts 162 may include templates or parameters used by thenetwork management system 120 to generate a PAC script based on a devicelocation. For example, the PAC scripts 162 may include standardinstructions that the network management system 120 may modify based onthe determined location of the device.

Database 160 also includes device locations 164. The device locations164 may include the determined locations for each of the one or moredevices 130 a-c and the device 170. The database 160 may store a devicelocation after receiving the determined location for a device from thenetwork management system 120. The database 160 may also update thedevice locations 164 if the determined location for a device from thenetwork management system 120 is different from the stored location ofthe device.

The gateway server 140 connects the internal network 110 to the externalnetwork 150. As shown, the environment 100 also includes a gatewayserver 140 connected to the internal network 110 and the externalnetwork 150. In some implementations, the gateway server 140 is agateway to a wide-area network (WAN), such as the external network 150,for the one or more devices 130 a-c. Requests to access the externalnetwork 150 made by the one or more devices 130 a-c may be first passedto the gate server 140, which will then pass the request on to theexternal network 150. In some implementations, the gateway server 140may perform filtering on these requests, such as blocking access toresources on the external network 150 that are known to includeobjectionable or otherwise prohibited content. The gateway server 140may perform this filtering by analyzing requests sent by the one or moredevices 130 a-c, identifying requests for Uniform Resource Locators(URLs) of known prohibited sites, and returning a response to thesending device indicating that the request will not be fulfilled.

As shown, the gateway server 140 is connected to the external network150. In some implementations, the external network 150 is the publicInternet. The external network 150 may also be any network orcombination of networks accessed from the internal network 110 via thegateway server 140. In such an implementation, the external network 150may be public, private, or a combination of the two. In someimplementations, the external network 150 is a distributed networkutilizing the Transmission Control Protocol (TCP) in combination withHTTP to transmit requests for pages to web servers connected to theexternal network 150, and to transmit responses from the web servers tothe requesting clients.

In some implementations, after the user-specific credentials arereceived and verified, the gateway server 140 may associate each requestreceived from the one or more devices 130 a-c with the specific usercurrently using the device in question. This association may occur byexamining the device-specific credentials received with the request anddetermining the currently associated user-specific credentials. In someimplementations, the gateway server 140 may apply a user-specificprofile to requests from the one or more devices 130 a-c based on theassociated user-specific credentials. In some instances, the gatewayserver 140 may use the correlation between user and device to log usersoff of shared devices after a maximum usage time is reached.

FIG. 2 is a message flow diagram of an example interaction 200 betweenthe components of the example network 100 to generate PAC scripts basedthe locations of the devices. In some implementations, the interaction200 may include additional and/or different components not shown in themessage flow diagram. Components may also be omitted from theinteraction 200, and additional messages may be added to the interaction200.

At 205, the network management system 120 pushes proxy settings to theuser device 170. The proxy settings may include a PAC script URLspecific to the user device 170. In some cases, the network managementsystem 120 may push proxy settings to the user device 170 according toone or more network management protocols, including, but not limited to,DHCP, BOOTP, and/or other protocols.

At 210, the network management system 120 pushes proxy settings to theuser device 130 a. The proxy settings may include a PAC script URLspecific to the user device 130 a. In some cases, the network managementsystem 120 may push proxy settings to the user device 130 a according toone or more network management protocols, including, but not limited to,DHCP, BOOTP, and/or other protocols.

At 215, the user device 130 a requests a PAC script from the PAC scriptURL received from the network management system 120 at 210. In somecases, the user device 130 a requests the PAC script via HTTP, such asby sending an HTTP GET request for the configured PAC script URL. Theuser device 130 a may also request the PAC script via other mechanismsor protocols.

At 220, the network management system 120 determines the location of theuser device 130 a. In some implementations, the network managementsystem 120 may determine the location of the device 130 a based on thesource address associated with the user device 130 a. In the illustratedexample, the user device 130 a is connected to the internal network, andthe source address associated with the user device 130 a is a localnetwork address. Accordingly, the network management system 120 maydetermine that the location of the user device 130 a is on-premise.

At 225, the network management system 120 sends a response to the userdevice 130 a that includes a PAC script based on the location of theuser device 130 a. The PAC script includes instructions to be executedby the user device 130 a for accessing the external network. In theillustrated example, the network management system 120 determines thatthe location of the user device 130 a is on-premise, and thereforereturns an “on-premise” PAC script to the user device 130 a. The“on-premise” PAC script may include instructions configured to routenetwork traffic through the gateway server 140. In some implementations,the PAC script may be generated in response to the received request.

At 230, the user device 130 a sends a request via HTTP for the website180 on the external network. Based on the “on-premise” PAC script theuser device 130 a received at 225, the user device 130 a sends therequest through the gateway server 140. At 235, the gateway 140 forwardsthe HTTP request to the website 180. The gateway 140 may forward therequest after the gateway 140 analyzes and filters the request based onprovisioned security functions.

At 240, the user device 170 requests a PAC script from the PAC scriptURL it received from the network management system 120 at 205. In somecases, the user device 170 requests the PAC script via HTTP, such as bysending an HTTP GET request for the configured PAC script URL.

At 245, the network management system 120 determines the location of theuser device 170. In the illustrated example, the user device 170 isconnected to the external network, and the source address associatedwith the user device 170 is a public network address. By examining thissource address, the network management system 120 may determine that thelocation of the user device 170 is off-premise.

At 250, the network management system 120 sends a response to the userdevice 170 that includes a PAC script based on the determined locationof the user device 170. In the illustrated example, the networkmanagement system 120 determines that the location of the user device170 is off-premise, and therefore returns an “off-premise” PAC script tothe user device 170. The “off-premise” PAC script may includeinstructions configured to route network traffic directly to theexternal network.

At 255, the device 170 sends a request via HTTP for the website 180 onthe external network. Based on the “off-premise” PAC script that theuser device 170 received at 250, the user device 170 sends the requestdirectly to the website 180.

FIG. 3 is a flow chart of an example process 300 of generating PACscripts based on locations of user devices.

At 305, a request for a PAC script is received from a source addressassociated with a device. In some implementations, the request for thePAC script includes a HTTP request. In some implementations, the deviceis a network device such as a cell phone, a laptop, a desktop, and/orother devices. In some implementations, the source address is an IPaddress.

At 310, the location of the device is determined based at least in parton the source address associated with the device. In someimplementations, the location of the device is determined to beon-premise based on the source address being a local network address. Insome implementations, the location of the device is determined to beoff-premise based on the source address being a public network address.

At 315, a PAC script is generated based at least in part on thedetermined location of the device. The PAC script may includeinstructions to be executed by the device when connecting to theexternal network. The instructions may be coded in a programminglanguage such as JavaScript, Python, Perl, PHP, and/or other programminglanguages. In some implementations, if the location of the device isdetermined to be on-premise, a first PAC script is generated. The firstPAC script may include instructions configured to route network trafficthrough a gateway server. If the location of the device is determined tobe off-premise, a second PAC script may be generated. The second PACscript may be different than the first PAC script. For example, thesecond PAC script may include instructions configured to route networktraffic directly to the external network.

At 320, a response to the request for the PAC script is sent includingthe generated PAC script. For example, a response to the request from asource address associated with an on-premise device may include thefirst PAC script. A response to the request from a source addressassociated with an off-premise device may include the second PAC script.The first PAC script or the second PAC script may be sent to the devicevia a network protocol, such as HTTP, File Transfer Protocol (FTP),and/or other network protocols.

FIG. 4 is a block diagram of computing devices 400, 450 that may be usedto implement the systems and methods described in this document, aseither a client or as a server or plurality of servers. Computing device400 is intended to represent various forms of digital computers, such aslaptops, desktops, workstations, personal digital assistants, servers,blade servers, mainframes, and other appropriate computers. Computingdevice 450 is intended to represent various forms of mobile devices,such as personal digital assistants, cellular telephones, smartphones,and other similar computing devices. Additionally computing device 400or 450 can include Universal Serial Bus (USB) flash drives. The USBflash drives may store operating systems and other applications. The USBflash drives can include input/output components, such as a wirelesstransmitter or USB connector that may be inserted into a USB port ofanother computing device. The components shown here, their connectionsand relationships, and their functions, are meant to be exemplary only,and are not meant to limit implementations of the inventions describedand/or claimed in this document.

Computing device 400 includes a processor 402, memory 404, a storagedevice 406, a high-speed interface 408 connecting to memory 404 andhigh-speed expansion ports 410, and a low speed interface 412 connectingto low speed bus 414 and storage device 406. Each of the components 402,404, 406, 408, 410, and 412, are interconnected using various busses,and may be mounted on a common motherboard or in other manners asappropriate. The processor 402 can process instructions for executionwithin the computing device 400, including instructions stored in thememory 404 or on the storage device 406 to display graphical informationfor a GUI on an external input/output device, such as display 416coupled to high speed interface 408. In other implementations, multipleprocessors and/or multiple buses may be used, as appropriate, along withmultiple memories and types of memory. Also, multiple computing devices400 may be connected, with each device providing portions of thenecessary operations (e.g., as a server bank, a group of blade servers,or a multi-processor system).

The memory 404 stores information within the computing device 400. Inone implementation, the memory 404 is a volatile memory unit or units.In another implementation, the memory 404 is a non-volatile memory unitor units. The memory 404 may also be another form of computer-readablemedium, such as a magnetic or optical disk.

The storage device 406 is capable of providing mass storage for thecomputing device 400. In one implementation, the storage device 406 maybe or contain a computer-readable medium, such as a floppy disk device,a hard disk device, an optical disk device, or a tape device, a flashmemory or other similar solid state memory device, or an array ofdevices, including devices in a storage area network or otherconfigurations. A computer program product can be tangibly embodied inan information carrier. The computer program product may also containinstructions that, when executed, perform one or more methods, such asthose described above. The information carrier is a computer- ormachine-readable medium, such as the memory 404, the storage device 406,or memory on processor 402.

The high speed controller 408 manages bandwidth-intensive operations forthe computing device 400, while the low speed controller 412 manageslower bandwidth-intensive operations. Such allocation of functions isexemplary only. In one implementation, the high-speed controller 408 iscoupled to memory 404, display 416 (e.g., through a graphics processoror accelerator), and to high-speed expansion ports 410, which may acceptvarious expansion cards (not shown). In the implementation, low-speedcontroller 412 is coupled to storage device 406 and low-speed expansionbus 414. The low-speed expansion port, which may include variouscommunication ports (e.g., USB, Bluetooth, Ethernet, wireless Ethernet)may be coupled to one or more input/output devices, such as a keyboard,a pointing device, a scanner, or a networking device such as a switch orrouter, e.g., through a network adapter.

The computing device 400 may be implemented in a number of differentforms, as shown in the figure. For example, it may be implemented as astandard server 420, or multiple times in a group of such servers. Itmay also be implemented as part of a rack server system 424. Inaddition, it may be implemented in a personal computer such as a laptopcomputer 422. Alternatively, components from computing device 400 may becombined with other components in a mobile device (not shown), such asdevice 450. Each of such devices may contain one or more of computingdevice 400, 450, and an entire system may be made up of multiplecomputing devices 400, 450 communicating with each other.

Computing device 450 includes a processor 452, memory 464, aninput/output device such as a display 454, a communication interface466, and a transceiver 468, among other components. The device 450 mayalso be provided with a storage device, such as a microdrive or otherdevice, to provide additional storage. Each of the components 450, 452,464, 454, 466, and 468, are interconnected using various buses, andseveral of the components may be mounted on a common motherboard or inother manners as appropriate.

The processor 452 can execute instructions within the computing device450, including instructions stored in the memory 464. The processor maybe implemented as a chipset of chips that include separate and multipleanalog and digital processors. Additionally, the processor may beimplemented using any of a number of architectures. For example, theprocessor 452 may be a CISC (Complex Instruction Set Computers)processor, a RISC (Reduced Instruction Set Computer) processor, or anMISC (Minimal Instruction Set Computer) processor. The processor mayprovide, for example, for coordination of the other components of thedevice 450, such as control of user interfaces, applications run bydevice 450, and wireless communication by device 450.

Processor 452 may communicate with a user through control interface 458and display interface 456 coupled to a display 454. The display 454 maybe, for example, a TFT (Thin-Film-Transistor Liquid Crystal Display)display or an OLED (Organic Light Emitting Diode) display, or otherappropriate display technology. The display interface 456 may compriseappropriate circuitry for driving the display 454 to present graphicaland other information to a user. The control interface 458 may receivecommands from a user and convert them for submission to the processor452. In addition, an external interface 462 may be provided incommunication with processor 452, so as to enable near areacommunication of device 450 with other devices. External interface 462may provide, for example, for wired communication in someimplementations, or for wireless communication in other implementations,and multiple interfaces may also be used.

The memory 464 stores information within the computing device 450. Thememory 464 can be implemented as one or more of a computer-readablemedium or media, a volatile memory unit or units, or a non-volatilememory unit or units. Expansion memory 474 may also be provided andconnected to device 450 through expansion interface 472, which mayinclude, for example, a SIMM (Single In Line Memory Module) cardinterface. Such expansion memory 474 may provide extra storage space fordevice 450, or may also store applications or other information fordevice 450. Specifically, expansion memory 474 may include instructionsto carry out or supplement the processes described above, and mayinclude secure information also. Thus, for example, expansion memory 474may be provided as a security module for device 450, and may beprogrammed with instructions that permit secure use of device 450. Inaddition, secure applications may be provided via the SIMM cards, alongwith additional information, such as placing identifying information onthe SIMM card in a non-hackable manner.

The memory may include, for example, flash memory and/or NVRAM memory,as discussed below. In one implementation, a computer program product istangibly embodied in an information carrier. The computer programproduct contains instructions that, when executed, perform one or moremethods, such as those described above. The information carrier is acomputer- or machine-readable medium, such as the memory 464, expansionmemory 474, or memory on processor 452 that may be received, forexample, over transceiver 468 or external interface 462.

Device 450 may communicate wirelessly through communication interface466, which may include digital signal processing circuitry wherenecessary. Communication interface 466 may provide for communicationsunder various modes or protocols, such as GSM voice calls, SMS, EMS, orMMS messaging, CDMA, TDMA, PDC, WCDMA, CDMA2000, or GPRS, among others.Such communication may occur, for example, through radio-frequencytransceiver 468. In addition, short-range communication may occur, suchas using a Bluetooth, WiFi, or other such transceiver (not shown). Inaddition, GPS (Global Positioning System) receiver module 470 mayprovide additional navigation- and location-related wireless data todevice 450, which may be used as appropriate by applications running ondevice 450.

Device 450 may also communicate audibly using audio codec 460, which mayreceive spoken information from a user and convert it to usable digitalinformation. Audio codec 460 may likewise generate audible sound for auser, such as through a speaker, e.g., in a handset of device 450. Suchsound may include sound from voice telephone calls, may include recordedsound (e.g., voice messages, music files, etc.) and may also includesound generated by applications operating on device 450.

The computing device 450 may be implemented in a number of differentforms, as shown in the figure. For example, it may be implemented as acellular telephone 480. It may also be implemented as part of asmartphone 482, personal digital assistant, or other similar mobiledevice.

Various implementations of the systems and techniques described here canbe realized in digital electronic circuitry, integrated circuitry,specially designed ASICs (application specific integrated circuits),computer hardware, firmware, software, and/or combinations thereof.These various implementations can include implementation in one or morecomputer programs that are executable and/or interpretable on aprogrammable system including at least one programmable processor, whichmay be special or general purpose, coupled to receive data andinstructions from, and to transmit data and instructions to, a storagesystem, at least one input device, and at least one output device.

These computer programs (also known as programs, software, softwareapplications or code) include machine instructions for a programmableprocessor, and can be implemented in a high-level procedural and/orobject-oriented programming language, and/or in assembly/machinelanguage. As used herein, the terms “machine-readable medium” and“computer-readable medium” refer to any computer program product,apparatus and/or device (e.g., magnetic discs, optical disks, memory,Programmable Logic Devices (PLDs)) used to provide machine instructionsand/or data to a programmable processor, including a machine-readablemedium that receives machine instructions as a machine-readable signal.The term “machine-readable signal” refers to any signal used to providemachine instructions and/or data to a programmable processor.

To provide for interaction with a user, the systems and techniquesdescribed here can be implemented on a computer having a display device(e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor)for displaying information to the user and a keyboard and a pointingdevice (e.g., a mouse or a trackball) by which the user can provideinput to the computer. Other kinds of devices can be used to provide forinteraction with a user, as well; for example, feedback provided to theuser can be any form of sensory feedback (e.g., visual feedback,auditory feedback, or tactile feedback); and input from the user can bereceived in any form, including acoustic, speech, or tactile input.

The systems and techniques described here can be implemented in acomputing system that includes a back-end component (e.g., as a dataserver), or that includes a middleware component (e.g., an applicationserver), or that includes a front end component (e.g., a client computerhaving a graphical user interface or a Web browser through which a usercan interact with an implementation of the systems and techniquesdescribed here), or any combination of such back end, middleware, orfront-end components. The components of the system can be interconnectedby any form or medium of digital data communication (e.g., acommunication network). Examples of communication networks include alocal area network (“LAN”), a wide area network (“WAN”), peer-to-peernetworks (having ad-hoc or static members), grid computinginfrastructures, and the Internet.

The computing system can include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client-server relationship to each other.

Although a few implementations have been described in detail above,other modifications are possible. In addition, the logic flows depictedin the figures do not require the particular order shown, or sequentialorder, to achieve desirable results. Other steps may be provided, orsteps may be eliminated, from the described flows, and other componentsmay be added to, or removed from, the described systems. Accordingly,other implementations are within the scope of the following claims.

What is claimed is:
 1. A computer-implemented method executed by one ormore processors, the method comprising: receiving a request for a proxyautomatic configuration (PAC) script from a source address associatedwith a device; determining a classification for the source address;determining, based at least in part on the determined classification, alocation of the device; generating a PAC script based at least in parton the determined location of the device; and sending a response to therequest for the PAC script including the generated PAC script.
 2. Themethod of claim 1, wherein determining the location of the deviceincludes determining whether the device is on-premise or off-premise. 3.The method of claim 2, wherein generating the PAC script based at leastin part on the determined location of the device includes generating afirst PAC script if the device is determined to be on-premise, andgenerating a second PAC script different than the first PAC script ifthe device is determined to be off-premise.
 4. The method of claim 3,wherein the first PAC script includes instructions configured to routenetwork traffic through a gateway server.
 5. The method of claim 3,wherein the second PAC script includes instructions configured to routenetwork traffic directly to network resources.
 6. The method of claim 1,wherein determining the classification of the source address includesdetermining that the source address is a local network address.
 7. Themethod of claim 1, wherein determining the classification of the sourceaddress includes determining that the source address is a public networkaddress.
 8. The method of claim 1, wherein receiving the request for thePAC script includes receiving a Hypertext Transfer Protocol (HTTP)request, and the source address is an Internet Protocol (IP) address. 9.A system comprising: a processor configured to execute computer programinstructions; and a tangible, non-transitory computer storage mediumencoded with computer program instructions that, when executed by theprocessor, cause the system to perform operations comprising: receivinga request for a proxy automatic configuration (PAC) script from a sourceaddress associated with a device; determining a classification for thesource address; determining, based at least in part on the determinedclassification, a location of the device; generating a PAC script basedat least in part on the determined location of the device; and sending aresponse to the request for the PAC script including the generated PACscript.
 10. The system of claim 9, wherein determining the location ofthe device includes determining whether the device is on-premise oroff-premise.
 11. The system of claim 10, wherein generating the PACscript based at least in part on the determined location of the deviceincludes generating a first PAC script if the device is determined to beon-premise, and generating a second PAC script different than the firstPAC script if the device is determined to be off-premise.
 12. The systemof claim 11, wherein the first PAC script includes instructionsconfigured to route network traffic through a gateway server.
 13. Thesystem of claim 11, wherein the second PAC script includes instructionsconfigured to route network traffic directly to network resources. 14.The system of claim 9, wherein determining the classification of thesource address includes determining that the source address is a localnetwork address.
 15. The system of claim 9, wherein determining theclassification of the source address includes determining that thesource address is a public network address.
 16. The system of claim 9,wherein receiving the request for the PAC script includes receiving aHypertext Transfer Protocol (HTTP) request, and the source address is anInternet Protocol (IP) address.
 17. A non-transitory, computer-readablemedium storing instructions operable when executed to cause at least oneprocessor to perform operations comprising: receiving a request for aproxy automatic configuration (PAC) script from a source addressassociated with a device; determining a classification for the sourceaddress; determining, based at least in part on the determinedclassification, a location of the device; generating a PAC script basedat least in part on the determined location of the device; and sending aresponse to the request for the PAC script including the generated PACscript.
 18. The computer readable medium of claim 17, whereindetermining the location of the device includes determining whether thedevice is on-premise or off-premise.
 19. The computer readable medium ofclaim 18, wherein generating the PAC script based at least in part onthe determined location of the device includes generating a first PACscript if the device is determined to be on-premise, and generating asecond PAC script different than the first PAC script if the device isdetermined to be off-premise.
 20. The computer readable medium of claim17, wherein the first PAC script includes instructions configured toroute network traffic through a gateway server.
 21. The computerreadable medium of claim 17, wherein determining the classification ofthe source address includes determining that the source address is alocal network address.
 22. The computer readable medium of claim 17,wherein determining the classification of the source address includesdetermining that the source address is a public network address.